package com.fin.zw.intelligentbot.entity;

import com.fin.zw.intelligentbot.enums.RobotStatus;
import com.fin.zw.intelligentbot.enums.Whether;
import lombok.Data;
import org.hibernate.annotations.Table;

import javax.persistence.*;

@Data
@Table(appliesTo = "robot_info",comment="机器人信息表")
@Entity
public class RobotInfo extends BaseEntity{

    @Column(columnDefinition = "varchar(100) COMMENT '名称'")
    private String name;

    @Column(columnDefinition = "varchar(20) COMMENT '是否显示名称'")
    @Enumerated(EnumType.STRING)
    private Whether displayName;

    @Column(columnDefinition = "varchar(20) COMMENT '状态'")
    @Enumerated(EnumType.STRING)
    private RobotStatus status;

    @Column(columnDefinition = "varchar(20) COMMENT '机器人编号'")
    private String code;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sce_id",columnDefinition = "varchar(64) COMMENT '场景id'")
    private SceneInfo sceneInfo;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "line_id",columnDefinition = "varchar(64) COMMENT '线路id'")
    private LineInfo gateway;

    @OneToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @JoinColumn(name = "company_id",columnDefinition = "varchar(64) COMMENT '企业id'")
    private Company company;

    @OneToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @JoinColumn(name = "nlp_id", columnDefinition = "varchar(64) COMMENT '智能语音id'")
    private AiConfiguration nlp;

    @OneToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @JoinColumn(name = "asr_id",columnDefinition = "varchar(64) COMMENT '语音识别id'")
    private AiConfiguration asr;

    @OneToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @JoinColumn(name = "tts_id",columnDefinition = "varchar(64) COMMENT '语音合成id'")
    private AiConfiguration tts;
}
